import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function page(limit, offset, reading, type) {
  return request({
    url: '/system/baseMsg/getPage',
    method: 'post',
    data: qs.stringify({
      limit,
      offset,
      reading,
      type
    })
  })
}

/**
 * 获取未读消息数量
 * @param limit
 * @param offset
 */
export function getNoReadCount() {
  return request({
    url: '/system/baseMsg/getNoReadCount',
    method: 'post',
    data: qs.stringify({})
  })
}

/**
 * 获取详情信息
 * @param limit
 * @param offset
 */
export function getInfo(id) {
  return request({
    url: '/system/baseMsg/getInfo',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 批量设置已读
 * @param limit
 * @param offset
 */
export function readBatch(idStr) {
  return request({
    url: '/system/baseMsg/readBatch',
    method: 'post',
    data: qs.stringify({
      idStr
    })
  })
}
